package com.feishi.core.util.common.bean;

/**
 * @version 1.0
 * @auth caixq
 * @time 17-12-28 13:44
 **/
public class Section {
    private double start;
    private double end;
    private boolean withStart=true;
    private boolean withEnd=true;
    private boolean empty;

    public boolean isEmpty() {
        return empty;
    }

    public void setEmpty(boolean empty) {
        this.empty = empty;
    }

    public Section(double start, double end) {
        this(start,end,true,true);
    }

    public Section(double start, double end, boolean withStart, boolean withEnd) {
        this.start = start;
        this.end = end;
        this.withStart = withStart;
        this.withEnd = withEnd;
        empty=start>end||(start==end&&withStart&&withEnd);
    }

    public double getStart() {
        return start;
    }

    public void setStart(double start) {
        this.start = start;
    }

    public double getEnd() {
        return end;
    }

    public void setEnd(double end) {
        this.end = end;
    }

    public boolean isWithStart() {
        return withStart;
    }

    public void setWithStart(boolean withStart) {
        this.withStart = withStart;
    }

    public boolean isWithEnd() {
        return withEnd;
    }

    public void setWithEnd(boolean withEnd) {
        this.withEnd = withEnd;
    }

    @Override
    public String toString() {
        return "Section:" +(withStart?'[':'(')+start+','+end+(withStart?']':')');
    }
}
